﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KillerApps.Emulation.Atari.Lynx.Cryptography
{
	public static class LynxRsaCryptographicKeys
	{
		private static byte[] PublicModulusBytes = new byte[51] {
				0x35, 0xB5, 0xA3, 0x94, 0x28, 0x06, 0xD8, 0xA2, 0x26, 0x95, 0xD7, 0x71, 0xB2, 0x3C, 0xFD, 0x56,
				0x1C, 0x4A, 0x19, 0xB6, 0xA3, 0xB0, 0x26, 0x00, 0x36, 0x5A, 0x30, 0x6E, 0x3C, 0x4D, 0x63, 0x38,
				0x1B, 0xD4, 0x1C, 0x13, 0x64, 0x89, 0x36, 0x4C, 0xF2, 0xBA, 0x2A, 0x58, 0xF4, 0xFE, 0xE1, 0xFD,
				0xAC, 0x7E, 0x79
		};

		private static byte[] PublicExponentBytes = new byte[51] {
				0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
				0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
				0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
				0x00, 0x00, 0x03
		};

		private static byte[] PrivateExponentBytes = new byte[51] {
				0x23, 0xce, 0x6d, 0x0d, 0x70, 0x04, 0x90, 0x6c, 0x19, 0xb9, 0x3a, 0x4b, 0xcc, 0x28, 0xa8, 0xe4, 
				0x12, 0xdc, 0x11, 0x24, 0x6d, 0x20, 0x19, 0x55, 0x79, 0x87, 0xab, 0x5c, 0xa8, 0x18, 0xa3, 0xd3, 
				0xc8, 0xe3, 0x27, 0x6d, 0x42, 0x70, 0xcb, 0x80, 0x21, 0xd6, 0xbd, 0xa4, 0x29, 0x6d, 0x47, 0xb1, 
				0xe5, 0xe2, 0xa3
		};

		public static byte[] PrivateExponent { get { return CreateCopy(PrivateExponentBytes); } }
		public static byte[] PublicExponent { get { return CreateCopy(PublicExponentBytes); } }
		public static byte[] PublicModulus { get { return CreateCopy(PublicModulusBytes); } }

		private static byte[] CreateCopy(byte[] data)
		{
			byte[] copy = new byte[data.Length];
			Array.Copy(data, copy, data.Length);
			return copy;
		}
	}
}
